﻿using System;
using System.Collections.Generic;
using System.Text;
using OSGeo.MapGuide;
using System.Drawing;

namespace MapViewer
{
    public interface IMapViewer : IMapViewerComponent
    {
        void ClearSelection();

        /*
        void DigitizeCircle();
        void DigitizeLine();
        void DigitizePoint();
        void DigitizePolygon();
        void DigitizeLineString();
        void DigitizeRectangle();
         */

        MgdMap GetMap();
        MgdSelection GetSelection();

        bool IsBusy { get; }
        event EventHandler BusyStateChanged;

        bool IsDigitizing { get; }
        event EventHandler DigitizationStateChanged;

        void RefreshMap(bool raiseEvents);
        event EventHandler MapRefreshed;

        void ZoomToView(double x, double y, double scale, bool refresh);

        event EventHandler MapScaleChanged;
        event EventHandler SelectionChanged;

        event EventHandler ViewerInitialized;

        MapActiveTool ActiveTool { get; set; }

        event EventHandler MapActiveToolChanged;
        event EventHandler<MapPointEventArgs> MouseMapPositionChanged;
    }

    public class MapPointEventArgs : EventArgs 
    {
        public readonly double X;
        public readonly double Y;

        public MapPointEventArgs(double x, double y)
        {
            this.X = x; 
            this.Y = y;
        }
    }

    public enum MapActiveTool
    {
        Zoom,
        Pan,
        Select,
        None
    }

    public class PointEventArgs : EventArgs
    {
        public PointEventArgs(PointF p) { this.Point = p; }

        public PointF Point { get; private set; }
    }
}
